package com.genius.service.impl;

import com.genius.mapper.DictDataMapper;
import com.genius.service.DictDataService;
import com.genius.system.pojo.DictData;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Slf4j
@Service
public class DictDataServiceImpl implements DictDataService {

    @Autowired
    private DictDataMapper dictDataMapper;

    @Override
    public List<DictData> selectDictDataByDictId(Long dictId) {
        return dictDataMapper.selectDictDataByDictId(dictId);
    }

    @Override
    public DictData selectDictDataById(Long dictDataId) {
        return dictDataMapper.selectDictDataById(dictDataId);
    }

    @Override
    @Transactional
    public int insertDictData(DictData dictData) {
        return dictDataMapper.insertDictData(dictData);
    }

    @Override
    @Transactional
    public int updateDictData(DictData dictData) {
        return dictDataMapper.updateDictData(dictData);
    }

    @Override
    @Transactional
    public int deleteDictDataByIds(Long[] ids) {
        return dictDataMapper.deleteDictDataByIds(ids);
    }
}
